'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class favorite extends Model {
    static associate(models) {
      // define association here
    }
  };
  favorite.init({
    id: {
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER,
      comment: 'id'
    },
    cookbook_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: 'id'
    },
    user_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: '用户id'
    },
    created_ip_at: {
      type: Sequelize.CHAR(15),
      allowNull: false,
      field: 'created_ip_at',
      defaultValue: '',
      comment: '收藏的ip地址'
    },
    undated_ip_at: {
      type: Sequelize.CHAR(15),
      allowNull: false,
      field: 'updated_ip_at',
      defaultValue: '',
      comment: '收藏更新的ip地址'
    },
    created_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'created_at',
      comment: '收藏的时间'
    },
    updated_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'updated_at',
      comment: '收藏更新的时间'
    }
  }, {
    sequelize,
    modelName: 'favorite',
    tableName: 'favorite'
  });
  return favorite;
};